home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\INCLUDE\IRC.$$$ < prev    next >
Text File  |  1994-12-29  |  7KB  |  323 lines

  1. /*
  2.  * irc.h: header file for all of ircII! 
  3.  *
  4.  * Written By Michael Sandrof
  5.  * Copyright(c) 1990 
  6.  *
  7.  * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
  8.  *
  9.  * @(#)$Id: irc.h,v 1.29 1994/10/16 00:31:36 mrg Stab $
  10.  */
  11.  
  12. #ifndef __irc_h
  13. #define __irc_h
  14.  
  15. #define IRCII_COMMENT   "this is a bug free client.  honest"
  16.  
  17. #define IRCRC_NAME "/.ircrc"
  18.  
  19. /*
  20.  * Here you can set the in-line quote character, normally backslash, to
  21.  * whatever you want.  Note that we use two backslashes since a backslash is
  22.  * also C's quote character.  You do not need two of any other character.
  23.  */
  24. #define QUOTE_CHAR '\\'
  25.  
  26. #if defined(ISC30)        /* for some reason it doesn't get defined */
  27. # define _POSIX_SOURCE
  28. #endif /* ISC30 */
  29.  
  30. #include "defs.h"
  31. #include "config.h"
  32. #include <stdio.h>
  33. #include <ctype.h>
  34. #ifdef _Windows
  35. #include <winsock.h>
  36. #include <signal.h>
  37. #else
  38. #include <sys/types.h>
  39. #include <sys/socket.h>
  40. #ifndef WINS
  41. #include <netinet/in.h>
  42. #else
  43. #include <sys/twg_config.h>
  44. #include <sys/in.h>
  45. #undef server
  46. #endif
  47. #include <arpa/inet.h>
  48. #include <signal.h>
  49. #include <sys/param.h>
  50. #endif
  51.  
  52. #ifdef TIME_WITH_SYS_TIME
  53. # include <sys/time.h>
  54. # include <time.h>
  55. #else
  56. # ifdef HAVE_SYS_TIME_H
  57. #  include <sys/time.h>
  58. # else
  59. #  include <time.h>
  60. # endif /* HAVE_SYS_TIME_H */
  61. #endif /* TIME_WITH_SYS_TIME */
  62.  
  63. #ifdef HAVE_SYS_FCNTL_H
  64. # include <sys/fcntl.h>
  65. #else
  66. # ifdef HAVE_FCNTL_H
  67. #  include <fcntl.h>
  68. # endif /* HAVE_FCNTL_H */
  69. #endif /* HAVE_SYS_FCNTL_H */
  70.  
  71.  
  72. /* machines we don't want to use <unistd.h> on 'cause its broken */
  73. #if defined(pyr) || defined(_SEQUENT_) || defined(IN_EXEC_C)
  74. # undef HAVE_UNISTD_H
  75. #endif
  76.  
  77. #ifdef HAVE_UNISTD_H
  78. # include <unistd.h>
  79. #endif
  80.  
  81. #ifdef HAVE_SYS_FILE_H
  82. # include <sys/file.h>
  83. #endif
  84.  
  85. #ifdef HAVE_NETDB_H
  86. # include <netdb.h>
  87. #endif
  88.  
  89. #if defined(__QNX__)
  90. # include <sys/select.h>
  91. # include <unix.h>
  92. # define BROKEN_GETPGRP 1
  93. # define USE_STDARG_H
  94. #endif
  95.  
  96. #ifdef HAVE_STDARG_H
  97. # include <stdarg.h>
  98. #endif
  99.  
  100. #include "irc_std.h"
  101. #include "debug.h"
  102.  
  103. /* these define what characters do, inverse, underline, bold and all off */
  104. #define REV_TOG        '\026'        /* ^V */
  105. #define UND_TOG        '\037'        /* ^_ */
  106. #define BOLD_TOG    '\002'        /* ^B */
  107. #define ALL_OFF        '\017'        /* ^O */
  108.  
  109. #define IRCD_BUFFER_SIZE    1024
  110. #define BIG_BUFFER_SIZE        (IRCD_BUFFER_SIZE * 2)
  111.  
  112. #ifndef INPUT_BUFFER_SIZE
  113. #define INPUT_BUFFER_SIZE    (IRCD_BUFFER_SIZE / 4)
  114. #endif
  115.  
  116. #ifdef notdef
  117. # define DAEMON_UID 1
  118. #endif
  119.  
  120. #define NICKNAME_LEN 9
  121. #define NAME_LEN 80
  122. #define REALNAME_LEN 50
  123. #define PATH_LEN 1024
  124.  
  125. #if defined(__hpux) || defined(hpux) || defined(_HPUX_SOURCE)
  126. # undef HPUX
  127. # define HPUX
  128. # ifndef HPUX7
  129. #  define killpg(pgrp,sig) kill(-pgrp,sig)
  130. # endif
  131. #endif
  132.  
  133. #if defined(__sgi)
  134. # define USE_TERMIO
  135. #endif /* __sgi */
  136.  
  137. #ifdef DGUX
  138. # define USE_TERMIO
  139. # define inet_addr(x) inet_network(x)    /* dgux lossage */
  140. #endif /* DGUX */
  141.  
  142. /*
  143.  * Lame Linux doesn't define X_OK in a non-broken header file, so
  144.  * we define it here.. 
  145.  */
  146. #if (defined(linux) || defined(__BORLANDC__)) && !defined(X_OK)
  147. # define X_OK  1
  148. # ifdef __BORLANDC__
  149. #  define F_OK 0
  150. #  define W_OK 2
  151. #  define R_OK 4
  152. # endif
  153. #endif /* linux */
  154.  
  155. #if __osf__
  156. # define _BSD
  157. #endif
  158.  
  159. #if defined(UNICOS) && !defined(USE_TERMIO)
  160. # define USE_TERMIO
  161. #endif /* UNICOS */
  162.  
  163. /* systems without getwd() can lose, if this dies */
  164. #if defined(NEED_GETCWD)
  165. # define getcwd(b, c)    getwd(b);
  166. #endif
  167.  
  168. #if defined(ISC22) || defined(ISC30)
  169. # define USE_TERMIO
  170. # define ISC
  171. #endif /* ISC22 || ISC30 */
  172.  
  173. #if defined(_AUX_SOURCE) && !defined(USE_TERMIO)
  174. # define USE_TERMIO
  175. #endif
  176.  
  177. #ifdef MAIL_DIR
  178. # undef UNIX_MAIL
  179. # define UNIX_MAIL MAIL_DIR
  180. #endif
  181.  
  182. /* flags used by who() and whoreply() for who_mask */
  183. #define WHO_OPS        0x0001
  184. #define WHO_NAME    0x0002
  185. #define WHO_ZERO    0x0004
  186. #define WHO_CHOPS    0x0008
  187. #define WHO_FILE    0x0010
  188. #define WHO_HOST    0x0020
  189. #define WHO_SERVER    0x0040
  190. #define    WHO_HERE    0x0080
  191. #define    WHO_AWAY    0x0100
  192. #define    WHO_NICK    0x0200
  193. #define    WHO_LUSERS    0x0400
  194. #define    WHO_REAL    0x0800
  195.  
  196. /*
  197.  (* Some defines in case we're using IRCII setuid->root, so that we can bind
  198.  * to privileged ports. This will allow future IRC nets to verify the true
  199.  * identity of users much more reliably.
  200.  */
  201. #ifdef PRIV_PORT
  202. # define    open        ruid_open
  203. # define    fopen        ruid_fopen
  204. # define    system        ruid_system
  205. # define    unlink        ruid_unlink
  206. # define    stat_file    ruid_stat
  207. #ifdef EOF    /* defined if stdio.h has been included */
  208. extern FILE *ruid_fopen();
  209. # endif /*EOF*/
  210. extern    int    ruid_open();
  211. extern    int    ruid_system();
  212. extern    int    ruid_unlink();
  213. #else
  214. # define stat_file stat
  215. #endif /*PRIV_PORT*/
  216.  
  217. /*
  218.  * declared in irc.c 
  219.  */
  220. extern    char    *cut_buffer;
  221. extern    char    oper_command;
  222. extern    int    irc_port;
  223. extern    int    send_text_flag;
  224. extern    int    irc_io_loop;
  225. extern    int    break_io_processing;
  226. extern    int    use_flow_control;
  227. extern    char    *joined_nick;
  228. extern    char    *public_nick;
  229. extern    char    empty_string[];
  230.  
  231. extern    char    irc_version[];
  232. extern    char    internal_version[];
  233. extern    char    buffer[];
  234. extern    char    nickname[];
  235. extern    char    *ircrc_file;
  236. extern    char    hostname[];
  237. extern    char    realname[];
  238. extern    char    username[];
  239. extern    char    *send_umode;
  240. extern    char    *last_notify_nick;
  241. extern    int    away_set;
  242. extern    int    background;
  243. extern    char    *my_path;
  244. extern    char    *irc_path;
  245. extern    char    *irc_lib;
  246. extern    char    *args_str;
  247. extern    char    *invite_channel;
  248. extern    int    who_mask;
  249. extern    char    *who_name;
  250. extern    char    *who_host;
  251. extern    char    *who_server;
  252. extern    char    *who_file;
  253. extern    char    *who_nick;
  254. extern    char    *who_real;
  255. extern    char    *cannot_open;
  256. extern    char    global_all_off[];
  257. extern    int    dumb;
  258. extern    int    use_input;
  259. extern    time_t    idle_time;
  260. extern    int    waiting;
  261. extern    char    wait_nick[];
  262. extern    char    whois_nick[];
  263. extern    char    lame_wait_nick[];
  264. extern    char    **environ;
  265. extern    int    current_numeric;
  266. extern    int    new_select();
  267.  
  268. extern    struct    in_addr    local_ip_address;
  269. extern    int    irc_io();
  270. extern    int    dgets();
  271. extern    time_t    dgets_timeout();
  272. extern    void    help();
  273. extern    char    *current_channel();
  274. extern    void    new_stty();
  275. extern    int    wild_match();
  276. extern    char    *new_malloc();
  277. extern    void    do_server();
  278. extern    char    *get_server_nickname();
  279. extern  int     connect_by_number();
  280. extern    int    is_channel();
  281. extern    void    irc_exit();
  282. extern    void    new_close();
  283. extern    void    beep_em();
  284. extern    void    set_socket_options __P((int));
  285. extern    char    *next_expr __P((char **, char));
  286.  
  287. typedef    struct    WhoisStuffStru
  288. {
  289.     char    *nick;
  290.     char    *user;
  291.     char    *host;
  292.     char    *channel;
  293.     char    *channels;
  294.     char    *name;
  295.     char    *server;
  296.     char    *server_stuff;
  297.     char    *away;
  298.     int    oper;
  299.     int    chop;
  300.     int    not_on;
  301. }    WhoisStuff;
  302.  
  303. /* Moved into here, because some weird CC's can't do (void *) */
  304. typedef    struct    WhoisQueueStru
  305. {
  306.     char    *nick;            /* nickname of whois'ed person(s) */
  307.     char    *text;            /* additional text */
  308.     int    type;            /* Type of WHOIS queue entry */
  309.     /*
  310.      * called with func((WhoisStuff *)stuff,(char *) nick, (char *) text) 
  311.      */
  312.     void    (*func)();
  313.     struct    WhoisQueueStru    *next;/* next element in queue */
  314. }    WhoisQueue;
  315.  
  316. extern    char    *getenv();
  317.  
  318. #ifdef _Windows
  319. typedef long off_t;
  320. #endif
  321.  
  322. #endif /* __irc_h */
  323.